
#ifndef UTILS_MATH
#define UTILS_MATH

#include <limits>
#include <cstring>
#include <iostream>
#include <chrono>

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>

#include "Vector.h"
#include "Matrix.h"
#include "Ray.h"
#include "Bounds.h"


static Matrix4f Ortho(
    const float left,	const float right,
    const float bottom, const float top,
    const float near,	const float far
) {
    return glm::ortho(left, right, bottom, top, near, far);
}

static Matrix4f Perspective(
    const float fov,
    const float aspectRatio,
    const float near,
    const float far
) {
    return glm::perspective(glm::radians(fov), aspectRatio, near, far);
}

static double GetRunTime() {
    static const auto startTimePoint = std::chrono::steady_clock::now();
    const auto currentTimePoint = std::chrono::steady_clock::now();
    const std::chrono::duration<double> duration = currentTimePoint - startTimePoint;
    return duration.count();
}

#endif // UTILS_MATH
